#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int main()
{
	int T;
	scanf("%d", &T);

	int i = 1;
	int j = 1;
	int n = 0;
	int sum = 0;
	int ele = 0;
	while (i <= T)
	{
		scanf("%d", &n);
		while (j <= n)
		{
			scanf("%d", &ele);
			j++;
			sum += ele;
		}
		printf("%d\n", sum);
		i++;
		j = 1;
		sum = 0;
	}

	return 0;
}